# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Ronald van Haren <ronald.archlinux.org>
# Contributor: bzklrm <bzklrm@gmail.com>
# Additional contributors Senjin, Xavier, dundee

pkgname=glpk
pkgver=5.0
pkgrel=2
pkgdesc='GNU Linear Programming Kit: solve LP, MIP and other problems'
arch=(loong64 x86_64)
url='https://www.gnu.org/software/glpk/glpk.html'
license=(GPL)
depends=(gmp)
source=(https://ftp.gnu.org/gnu/glpk/${pkgname}-${pkgver}.tar.gz{,.sig})
sha256sums=('4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15'
            'SKIP')
validpgpkeys=('A2B56CCB42220C06481335BAD17BF2305981E818') # Andrew Makhorin

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --with-gmp
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package(){
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 doc/{glpk,gmpl}.pdf -t "$pkgdir"/usr/share/doc/glpk/
}
